package com.sright.bcard.common.service.share.enums;

/**
 * 用户状态 0:未审核 1:已审核 2:未认领 3:已离职 4:未通过
 */
public enum UserStatusEnum {

    WAIT_AUDIT("未审核" , 0),
    AUDITED("已审核", 1),
    WAIT_CLAIM("未认领", 2),
    HAVE_LEFT("已离职", 3),
    NO_PASS("未通过", 4),
    ;
    private String name;

    private Integer code;

    UserStatusEnum(String name, Integer code) {
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static UserStatusEnum getEnum(String name) {
        try {
            return valueOf(name);
        } catch (Exception e) {
            return null;
        }
    }


    public static UserStatusEnum getEnumByValue(String value) {
        if (value == null) {
            return null;
        }

        for (UserStatusEnum item : UserStatusEnum.values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return null;
    }

    public Integer getValue() {
        return code;
    }

    public void setValue(Integer code) {
        this.code = code;
    }

}
